#ifndef __AT24C02_H
#define __AT24C02_H

#include "iic.h"

// 宏定义
#define W_ADDR 0xa0
#define R_ADDR 0Xa1

// 初始化
void AT24C02_Init(void);

// 向 EEPROM 写入一个字节
void AT24C02_WriteByte(uint8_t addr, uint8_t data);

// 从 EEPROM 读取一个字节
uint8_t AT24C02_ReadByte(uint8_t addr);

// 连续写入多个字节(页写)
void AT24C02_WriteBytes(uint8_t addr, uint8_t *bytes, uint8_t size);

// 连续读取多个字节
void AT24C02_ReadBytes(uint8_t addr, uint8_t *buffer, uint8_t size);

#endif